06. Building your Segmentation Network

Your tasks!

In order build a reliable network to work with the simulator, you need to implement code in the model_training.ipynb file.

You will need to fill out the encoder block as so:

def encoder_block(input_layer, filters, strides):

    # TODO Create a separable convolution layer using the 
    # separable_conv2d_batchnorm() function.

    return output_layer

Then the decoder block:

def decoder_block(small_ip_layer, large_ip_layer, filters):

    # TODO Upsample the small input layer using the bilinear_upsample() function.

    # TODO Concatenate the upsampled and large input layers using 
    # layers.concatenate.

    # TODO Add some number of separable convolution layers.

    return output_layer

And now the network itself:

def fcn_model(inputs, num_classes):

    # TODO Add Encoder Blocks. 
    # Remember that with each encoder layer, the depth of your model (the number of filters) increases.

    # TODO Add 1x1 Convolution layer using conv2d_batchnorm().

    # TODO: Add the same number of Decoder Blocks as the number of Encoder Blocks


    # The function returns the output layer of your model. "x" is the final layer obtained from the last decoder_block()
    return layers.Conv2D(num_classes, 1, activation='softmax', padding='same')(x)

These can be completed with what you learned from the lab. Most of the concepts you learned in the lab are transferable here, but feel free to explore some more by customizing the network as you see fit!

After you have built your network its time to pick hyper parameters:

learning_rate = 0
batch_size = 0
num_epochs = 0
steps_per_epoch = 200
validation_steps = 50
workers = 2

This can also be completed using what you learned in the lab. But remember, to get better performance you may need to optimize various hyperparameters, such as the learning rate and batch size (and others!), in order to increase overall network performance.